'''
电流环 大屏展示 数据查询统计服务
'''
from pymongo import MongoClient
from pao import log
from gov.data_process.tire_pressure.stat_TP_data import TP_Sim_Data
from flask import session


def register(jsonrpc, db_addr, db_port):
    TP_data_ser = TP_Sim_Data(db_addr, db_port)

    @jsonrpc.method('getdata.zgl')
    def zgl_service(starttime, endtime, TPID):
        nonlocal TP_data_ser
        res = TP_data_ser.cal_TP_data(starttime, endtime, TPID)
        return res
